import pytest


@pytest.fixture(scope="function")
def login_yield():
    print("\n登录操作   yield")
    yield
    print("执行完毕 teardown  yield")


@pytest.fixture()
def login(request):
    print("\n登录操作")

    def login_teardown():
        print("执行完毕 teardown")

    request.addfinalizer(login_teardown)


def test_login_2(login_yield):
    print("登录成功")
    print("执行接口查询")


def test_info_1(login_yield):
    print("执行发送请求")


if __name__ == '__main__':
    args = ["-s", "tearDown.py"]
    pytest.main(args)
